home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 12
/
Mac Magazin and MacEasy Magazine CD - Issue 12.iso
/
Sharewarebibliothek
/
Anwendungen
/
Rest
/
Soon4.7.1.sit 1 folder
/
Soon Doc
< prev
next >
Wrap
Text File
|
1995-06-25
|
12KB
|
207 lines
=-=-=-=-=-=-=-=-=
Welcome to Soon4!
=-=-=-=-=-=-=-=-=
A little calendar program which also tells you a lot about the sun and the moon
(hence the name: Soon - Sun & Moon)…
Soon started out as a fun project and was first posted to macgifts as "Soon3".
Thanks to Anders Eklof from Sweden it now comes in a "professional" version
"Soon4"!
Soon3 (and it's predecessors) used an algorithm which was an approximation for
the sunrise/-set time. I found it in some programmable pocket-calculator's
manual. It worked perfect for my location and my needs - but apparently nowhere
else! <:)
So I started to rewrite it (almost) completey from scratch. Only the output
somewhat resembles earlier versions. It's a completely new and correct algorithm
now, which should run no matter where you are on planet earth (according to
the astronomer's book I've taken it from…). It's deviation for the sun-times is
not more than one minute, for the moon-times not more than 4 and for the moon
data (phase, age) it's less than 0.3° between the years 1950-2050!
The "phrase" for the 4 moonphases is used within an interval of +/- 7 degr. of
the precise value to give a better "synchronization" with diaries etc…
The other 4 "phrases" are valid between those 4 just mentioned…
position° interval° phase-phrase
--------------------------------
0/360 354- 6 newmoon
7- 83 waxing crescent
90 84- 96 1st quarter (halfmoon, waxing)
97-173 waxing gibbous
180 174-186 fullmoon
187-263 waning gibbous
270 264-276 last quarter (halfmoon, waning)
277-353 waning crescent
The days of the moonphase and the degrees of the moonterminator are not rounded
in any way and show the exact values!
What Soon4 shows you:
---------------------
1. The weekday and date in "long form". The date format cen be set with STR-
resource #7 (see below). a "0" indicates MM/DD/YYYY, a "1" means DD.MM.YYYY
2. How many days are gone so far and how many are left this year, including
automatic leapyear detection
3. The current location and timezone including automatic DST detection.
They can be changed using either the "Set" button (see below) or any resource
editor - look in the STR resource of the "Soon Settings" file, they're named
and pretty self-explanatory.
The only exception is STR-resource #6 (DST-Mode), which musn't have any other
value than 0, 1 or 2! A value of 0 means DST is never in effect (e.g. in
Arizona), 1 or 2 select the two types of DST (see below in the paragraph
about DST)…
NOTE: Longitudes east from 0° are negative, as well as latitudes south from
the equator! The difference in hours from GMT also has to be prefixed
with a "-" if you're west from 0° (don't add another hour for DST here,
see explanation below…). The strings for the TimeZone are totally up to
you. Use whatever form you want to (CET, [GTM], (PST), EST/DST …)
4. Three different twilights:
The astronomical - starts/ends when the sun is 18° below horizon. That's
when no more daylight's left at all…
The nautical - 12° below horizon. Used for naval purposes, starts when the
brightest stars come out…
The civil - 6° below horizon. Ends when there just not enough light left for
work (traditional, that is :)
4.1 If you're beyond the polar circle (north or south) you're also noticed about
the polar night and the midnight sun…
5. Sunrise and -set times. Exact sunset is when the sun reaches the horizon (dis-
tance from zenith = 90°). But this is not what you are able to observe!
Due to refraction the sun appears elevated by more than its diameter (34 rad
minutes). This means if you can see the sun just hitting the horizon,
it's actually set already (geometrically speaking)…! The sun times given by
Soon tell the "visual" sunrise and -set (i.e. what you can see) using a ze-
nith distance of 90°50' (90.83_). 50'=34'(refraction)+16'(sun's radius)…
6. The moonphase with it's exact days, the position of the moonterminator and
a common phrase of the actual phase taking in account the current time (this
information is _not_ updated!). When you log this data to a file, these
values are for 12:00 o'clock (noon)…
7. Two analog clocks:
- Upper clock, which is a 24 hours analog clock. i.e. the hours are
positioned as follows: 00
18 06
12
it shows the start/end of daytime/nighttime (dt/nt) according to the sun-
rise/-set hours. The black part is "pure" night, using the astronomical
twilight hours while the grey parts are the twilight until the sun rises
or sets. This gives you a graphical impression of how much day-/nighthours
and twilight (getting less the closer you come to the equator) you have
that day…
- Lower clock - is a "usual" 12 hours analog clock. It's updated every second
and shows you the current time…
7.1 A graphic of the current moonphase - just as in every diary…
8. The buttons:
- The "Set" button, prompts the user for location/timezone data. First the
current settings are diplayed and you're asked if you want to change them.
If so, your prompted for each new value. Note the "-" prefixes on eastern
longitudes, southern latitudes and the time difference west from GMT! A
rough sanity check is done on this but it could be wrong on +/- 1 hour.
This information is stored in a seperate file called "Soon Settings", which
has to reside in the same folder as Soon does! If it's missing, Soon uses
it's default data (my home location) and when you set yours, a "Soon
Settings" file is created (in the same folder where Soon is in) and used
from then on. (Of course, if you're familiar with ResEdit, you can change
the default settings inside Soon's STR resource to your location and there-
fore no longer need the settings file!)
- The "Log" button, prompts the user for a start and end date and writes the
data to a textfile. The data written out to the file is exactly the same as
shown in the window, except for the notification about the polar night/mid-
nitesun. I thought I could skip this in a log, because it's showing over and
over again for a couple of weeks, but if anybody wants it added, no problem!
The given dates have to be in the form YYYYMMDD, which isn't very "user
friendly" but I didn't bother with a complex date-input/validation-routine…
If there's a big demand on this, I will however change it! Please note that
the dates are _not_ checked for integrity but if you enter "19940234" for
example, it will read "28.02., 01.03., 02.03., 03.03., 04.03." in the text
file… The only things that are checked on the entered dates are:
- no dates before 01.01.1901
- no dates after 31.12.2040
- period > 1 day
If you enter a value of 0 or any non-numerical data at either date, you'll
get straight back to the "main window"…
After you've entered valid dates, you get a window with 7 buttons. 6 of them
are "click" buttons. You can choose now, what data you want to be logged to
the file. "Everything" is the default, it gives you a complete list of every
day. When you deselect it, you have access to the other (no longer) dimmed
buttons. Check every "moon event" you want to be logged. All combinations
of these 4 are possible. Note: Logging all 4 events is _not_ the same as
logging "everything". The logfile will read only those 4 moonphases with
"gaps" between the days! When you deselect all 4 choices, these bottons dim
again and the "everything" box is checked.
The "Status line" check box is selected by default. Uncheck it if you don't
want a message added at the end of the log file about how long the compu-
tation took…
Once you've made up your mind, click in the "Do It!" button (or press the
RETURN key) and Soon will start logging the data to the file…
- The "Thank You" button, quits the program. Click on it or just press the
RETURN key. (I know, this is non-canon, the default button should be double
outlined but QB doesn't support this feature, sorry!)
All date/time calculations are based on the internal clock and DST is detected
automatically.
DST is active from the last Sunday in March until the last Sunday in September,
almost worldwide (DSTMode=1). In the UK (and some other countries) however, it
continues until the last Sunday in October. Therefore if you're in such a place,
set the resource-string "DST-Mode" to 2. A value of 0 disables DST completely…
I've been told (thanx, Paul Colquhoun) that on the southern hemispehre this is
just reversed, i.e. DST is engaged from either September or October till March,
or never at all, depending on the country. Soon checks this as well, so just
select a type of DST (0/1/2)…
Soon is written in Microsoft's QuickBasic (v1.00E-bin) and was mainly an exer-
cise for me to get used to the nooks and crannies of this Basic when it comes
to ToolStuff.
It runs on any Mac (only under System 7?) and it comes in two versions now, one
is plain 68000, the other is compiled to 68020/FPU code. If you have a math
co-processor, you'll have an acceleration of about factor 2, most noticable on
logfiles. Here's some benchmarks (P= plain version, F= FPU version):
P *** Status: 31 days in 6.77 secs, 4.58 days per sec…
F *** Status: 31 days in 3.07 secs, 10.11 days per sec…
P *** Status: 365 days in 85.00 secs, 4.29 days per sec…
F *** Status: 365 days in 40.92 secs, 8.92 days per sec…
Of course these numbers can differ, depending on your processor and hard disk
speed but they're only supposed to give you an estimation of the acceleration…
(I've also noticed a slight deviation in the 4th digit of the moonterminator's
fraction (E-4) of the plain version compared to the FPU version's output…)
(I've put this little program in my startup folder so that it displays it's
information on every boot-up…)
===============================================================================
Since I've added many features in V4 and spent a lot of time on debugging and
verification of the output, it would be nice if YOU, if you like this little
pgm and want to keep it, would send me anything from $2-$5 for it… (depending
on how wealthy you are and of how much use it is for you ;)
If you do, please send only US-Dollars - this makes things much easier for me
and don't forget to tell me your e-mail address (if any) so I can inform you
on future updates. If you want to, I can also put you on a mailing-list so you
get new versions sent (binhexed) straight away…
Thank you for your honesty and your support of the ShareWare concept!
===============================================================================
You're welcome to send any comments, ideas, bug-reports or whatever to my email
address and postcards from where you live to my snail-address!
have fun,
Christian Karpp
Mundenheimer Str. 222
67061 Lu
Germany
chk@cider.swb.de
chk@hd.ibm.de
Things in Soon "to come":
-------------------------
Calculation of moonrise & -set times. This is a b*tch! I've added all the
needed astronomical tables and formulas but still on some days the times
deviate up to 1 hour. most of the days are fine though, but I don't want to
hand out "half-made" things, so be patient…! :)
I'd also like to add code for reading user's location data directly from MAP's
CDEV settings. Unfortunately QB doesn't support the needed toolcall for this
operation…